package com.iflytek.jcy.supervise.clue.component.httpinterface;

import com.dtflys.forest.annotation.*;
import com.iflytek.jcy.supervise.clue.component.httpinterface.param.XxlJobInfo;
import com.iflytek.jcy.supervise.clue.component.httpinterface.result.*;

import java.util.List;

/** <br>
 * 标题:xxl-job接口 <br>
 * 描述: <br>
 * 公司: www.iflytek.com<br>
 * 
 * @autho dgyu
 * @time 2022年10月31日 下午1:26:56 */
// 整个接口下的所有方法请求都默认绑定该根地址
// @Address(source = HttpAddressSource.class) // 动态根地址
// @BaseRequest(interceptor = { SimpleInterceptor.class })
public interface XxlJobHttpInterface {

	@Post("#{xxl-job.url}#{xxl-job.myadd}")
	@Retry(maxRetryCount = "3", maxRetryInterval = "100")
	ReturnT<String> myadd(@JSONBody XxlJobInfo xxlJobInfo);

	@Post("#{xxl-job.url}#{xxl-job.myupdate}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> myupdate(@JSONBody XxlJobInfo xxlJobInfo);

	@Post("#{xxl-job.url}#{xxl-job.myremove}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> myremove(@Query("id") Integer id);

	@Post("#{xxl-job.url}#{xxl-job.mystop}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> mystop(@Query("id") Integer id);

	@Post("#{xxl-job.url}#{xxl-job.mystart}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> mystart(@Query("id") Integer id);

	@Post("#{xxl-job.url}#{xxl-job.mytrigger}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> mytrigger(@Query("id") Integer id,@Query("executorParam") String executorParam,@Query("addressList") String addressList);

	@Get("#{xxl-job.url}#{xxl-job.mykill}")
	@Retry(maxRetryCount = "5", maxRetryInterval = "100")
	ReturnT<String> mykill(@Query("id") Integer id);

	@Post("#{xxl-job.url}#{xxl-job.nextTriggerTimeById}")
	@Retry(maxRetryCount = "3", maxRetryInterval = "100")
	ReturnT<String> nextTriggerTimeById(@Query("id") Integer id);
}
